package com.wmm.fast.main.shop2State;

import lombok.extern.slf4j.Slf4j;

/**
 * @Auther: wangzun
 * @Date: 2018/9/13 16:26
 * @Description: 具体的状态实例A
 */
@Slf4j
public class ConcreteStateA implements State {

    @Override
    public void handler(Context context) {
        //满足则执行, 不满足则 相当于 else if指定下一个状态.为B
        if(context.getCount() == 1) {
            log.info("执行完了当前A状态应有的逻辑.切换状态");
        }
        context.state = new ConcreteStateB();
    }
}
